/*
 * @Author: wujingjing
 * @Date: 2023-10-30 18:05:08
 * @LastEditors: wujingjing
 * @LastEditTime: 2024-01-03 17:16:59
 * @FilePath: /dzh/src/api/link.ts
 * @Description:
 */
const env = import.meta.env.MODE;
console.info("env");
console.info(env);

const serve = `/custom-util/api/custom/v1`;

const ENV_LINKS = {
  BASE_API_URL: "",
  Account: `/manage/api`,
  Origin: `/api`,
  V1_custom:
    env === "development" ? "api/custom/v1/oss/admin" : `${serve}/oss/admin`,
  //字典
  DICT:
    env === "development"
      ? "/api/custom/v1/util_sysDict/admin/getDictList"
      : `/custom-util/api/custom/v1/util_sysDict/admin/getDictList`,
  //短信模块
  MESSAGE:
    env === "development" ? `/api/custom/v1` : `/custom-util/api/custom/v1`,
  //订阅模块
  SUBSCRIBLE: `/custom-util/api/subscribe/v1`,
  //门店模块
  STORE:
    env === "development"
      ? `/api/custom/v1/util_sysStore/admin`
      : `/custom-util/api/custom/v1/util_sysStore/admin`,
  //员工模块
  STAFF:
    env === "development"
      ? `/api/custom/v1/util_sysStaff/admin`
      : `/custom-util/api/custom/v1/util_sysStaff/admin`,
  //小程序模块
  WEAPP:
    env === "development"
      ? `/api/custom/v1/util_groupIng/admin`
      : `/custom-util/api/custom/v1/util_groupIng/admin`,
  //小程序页面配置
  WEAPP_PAGE:
    env === "development"
      ? `/api/custom/v1/util_pageConfig/admin`
      : `/custom-util/api/custom/v1/util_pageConfig/admin`,
  //小程序页面配置类型
  WEAPP_PAGE_TYPE:
    env === "development"
      ? `/api/custom/v1/util_configType/admin`
      : `/custom-util/api/custom/v1/util_configType/admin`,
  //小程序页面配置区块
  WEAPP_PAGE_BLOCK:
    env === "development"
      ? `/api/custom/v1/util_configTypeInfo/admin`
      : `/custom-util/api/custom/v1/util_configTypeInfo/admin`,
  V1_Sql: `${serve}/util_sql`,
  V1_Data: `${serve}/data`,
  V1_Base: `${serve}`,
  V1_Popup: `${serve}/popup`,
};
const URL = "http://192.168.1.22:8080/";
switch (env) {
  /**
   * dev 环境
   */
  case "local":
    ENV_LINKS.BASE_API_URL = URL;
    break;

  /**
   * dev 环境
   */
  case "development":
    ENV_LINKS.BASE_API_URL = URL;
    break;
  /**
   * pro 环境
   */
  case "production":
    ENV_LINKS.BASE_API_URL = URL;
    break;

  /**
   * dev 环境 打包编译
   */
  case "developmentbuild":
    ENV_LINKS.BASE_API_URL = URL;
    break;
  /**
   * pro 环境 打包编译
   */
  case "productionbuild":
    ENV_LINKS.BASE_API_URL = `http://192.168.1.130:8082/`;
    break;
}

export const LINKS = ENV_LINKS;
